{include file="header"}
<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
    <!--表单提交-->
        {if get('id',0) == '0'}
        <form class="layui-form" url="{:url('admin/api/add')}" t_url="javascript:parent.location.reload();">
        {else /}
        <form class="layui-form" url="{:url('admin/api/edit')}" t_url="javascript:parent.location.reload();">
        <input type="hidden" name="id" value="{$c.id}">
        {/if}
        <input type="hidden" name="model" value="link">
        <input type="hidden" name="wz" value="{:get('wz')}">
          <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
              <input type="text" name="name" value="{$c.name}" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">链接</label>
            <div class="layui-input-block">
              <input type="text" name="lianjie" lay-verify="required" value="{$c.lianjie}" autocomplete="off" placeholder="请输入链接地址" class="layui-input">
            </div>
          </div>
      {if get('wz')==2}
          <div class="layui-form-item">
            <label class="layui-form-label">到期时间</label>
            <div class="layui-input-inline">
              <input type="text" id="timed" name="timed" lay-verify="required"  value="{$c.timed}" autocomplete="off" placeholder="到期时间" class="layui-input">
            </div>
          </div>
		<script>
        layui.use('laydate', function(){
          var laydate = layui.laydate;
          laydate.render({
            elem: '#timed'
          });
        });
        </script>
      {/if}
          <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
              <input type="radio" name="open" value="1" title="显示" {if $c.open == 1}checked=""{/if}>
        <input type="radio" name="open" value="0" title="隐藏" {if $c.open == 0}checked=""{/if}>
      </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">新窗口</label>
            <div class="layui-input-block">
              <input type="radio" name="xin" value="1" title="是" {if $c.xin == 1}checked=""{/if}>
        <input type="radio" name="xin" value="0" title="否" {if $c.xin == 0}checked=""{/if}>
      </div>
          </div>
      <div class="layui-form-item">
            <label for="L_title" class="layui-form-label">排序</label>
              <div class="layui-input-inline" style="width: 100px;">
                <input type="number" name="px" value="{$c.px}" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
{include file="file"} 
{include file="footer"}